package cc.mxtt.common.app;

import cc.mxtt.common.interceptor.LoginInterceptor;
import cc.mxtt.common.utils.MD5Util;
import cc.mxtt.mvc.model.User;
import cc.mxtt.mvc.service.MenuService;
import cc.mxtt.mvc.service.PowerService;
import cc.mxtt.mvc.service.impl.MenuServiceImpl;
import cc.mxtt.mvc.service.impl.PowerServiceImpl;

import com.jfinal.aop.Clear;
import com.jfinal.core.Controller;
import com.jfinal.kit.JsonKit;

public class PowerControl extends Controller {
	
	PowerService menuService = new PowerServiceImpl();
	@Clear(LoginInterceptor.class)
	public void index(){
		renderText("hello");
	}
	
	public void tree(){
		String role_id = getPara(0);
		//顶级菜单的parent_id=0
		renderJson(JsonKit.toJson(menuService.getTree(role_id,"0")));
	}
	
	
	
	

}
